package com.mit.config;

import java.io.IOException;
import java.io.InputStream;
import java.util.Enumeration;
import java.util.Properties;

import org.apache.log4j.Logger;

public class FormatPattern {
	private static Logger logger = Logger.getLogger(FormatPattern.class);
	private static final String FILE_LOCATION = "resources/formatpattern.properties";
	private static Properties p = null;
	
	static{
		InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream(FILE_LOCATION);
		p = new Properties();
		try {
			p.load(is);			
		} catch (IOException e) {
			logger.error("Unable to read file: " + FILE_LOCATION, e);
		}		
		
	}
	

	public static String getShortDatePattern(){
		return p.getProperty("format.shortdate");
	}
	
	public static String getDatePattern(){
		return p.getProperty("format.date");
	}
	
	public static String getShortDateTimePattern(){
		return p.getProperty("format.shortdatetime");
	}
	
	public static String getDateTimePattern(){
		return p.getProperty("format.datetime");
	}
	
	public static String getFullDateTimePattern(){
		return p.getProperty("format.fulldatetime");
	}
	
	public static String getShortTimePattern(){
		return p.getProperty("format.shorttime");
	}
	
	public static String getTimePattern(){
		return p.getProperty("format.time");
	}
}
